package servlet;

import org.json.JSONObject;
import util.JwtUtil;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

import static util.JwtUtil.validateJWT;

public class receivePhotos extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 设置响应内容类型
        resp.setContentType("text/json; charset=utf-8");
        //        输出数据
        PrintWriter out = resp.getWriter();
//        判断是否是合法用户
        String token=req.getParameter("token");

        JSONObject jwt=new JSONObject();
        if(!validateJWT(token)){
            jwt.put("verify","false");
            out.print(jwt);
        }else {
            //        获取图片
            String value=req.getParameter("value");

        }


    }
}
